#pragma once
#include "SegmentationBase.h"
#include "itkCannySegmentationLevelSetImageFilter.h"

#include "itkVTKImageExport.h"
#include "vtkImageImport.h"
#include "vtkImageExport.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkActor.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkContourFilter.h"
#include "vtkImageData.h"
#include "vtkDataSet.h"
#include "vtkProperty.h"
#include "vtkImagePlaneWidget.h"
#include "vtkCellPicker.h"
#include "vtkPolyDataWriter.h"
#include "vtkProbeFilter.h"

class CannySegmentation : public SegmentationBase
{
public:
	CannySegmentation(void);
	~CannySegmentation(void);

	  /** Canny filter used to evolve the contours */
  typedef   itk::CannySegmentationLevelSetImageFilter< 
                                   InternalImageType2Df, 
                                   InternalImageType2Df,
                                   InternalPixelType >     CannyFilterType;
  
  /** Types for the visualization pipeline */
  typedef itk::VTKImageExport< InternalImageType3Df >        ExportFilterType;


    ThresholdFilterType::Pointer                m_CannyEdgesThresholdFilter;

  CannyFilterType::Pointer                    m_CannyFilter;

  virtual void ConnectPipelines( vtkImageImport * importer, 
                                 ExportFilterType * exporter );
    virtual void RunCanny();
	  virtual void SetThreshold( double value );
	  	  vtkImageImport *                            m_VtkImporter1;
  vtkImageImport *                            m_VtkImporter2;

  ExportFilterType::Pointer                   m_ItkExporter1;
  ExportFilterType::Pointer                   m_ItkExporter2;

  vtkContourFilter *                          m_ContourFilter;

  vtkPolyDataWriter *                         m_PolyDataWriter;

  vtkProbeFilter *                            m_ProbeFilter;

};
